The present invention relates generally to variable frequency dividers, and more particularly, to methods and apparatus for reducing the memory capacity needed to store control codes used to obtain specified frequency values.
Conventional music boxes rely on variable frequency dividers to generate melodies. To store melody information, however, these music boxes often require a large memory. If these music boxes use a dual-tone melody generator, the amount of memory needed to store melody information increases significantly.
FIG. 1 shows a block diagram of a conventional music box 100 which includes an oscillation circuit 110, a frequency divider 120, a melody read-only memory (ROM )130, a rhythm control circuit 140, an envelope generator 150, a control logic 160, an address generator 170, a digital-to-analog converter (DAC) 180, and a speaker 190. Oscillation circuit 110 generates a high-frequency pulse signal. Frequency divider 120 receives and divides the high frequency pulse signal into a melody note pitch tone according to output data from melody ROM 130. Melody ROM 130 contains pitch, tempo and rhythm information for generating a melody. Rhythm control circuit 140 controls the envelope, generated by envelope generator 150, and the duration of a melody. A melody output signal is generated through DAC 180 and sent to speaker 190. The frequency divider output signal determines the speaker output frequency and the output value of the envelope generator determines the amplitude.
In the conventional music box of FIG. 1, melody ROM 130 contains all of the melody information. Consequently, melody ROM 130 must be large enough to store all of the melody information. A typical dual-tone melody music box requires a 50 kHz oscillation circuit to generate a high frequency pulse signal. Melody ROM 130 stores an eight bit integer number to divide the high frequency signal into an actual sound pitch tone. Since each pitch tone requires storing eight bits of data, a total of 16 bits of data is needed for a dual-tone melody generator. Moreover, three bits of data storage are needed to control up to eight different rhythms generated by rhythm control circuit 140 and two bits of data storage are needed to control envelope generator 150. Therefore, a 21-bit memory width is required for a typical dual-tone music generator. Of the required 21 bit memory width, more than 70 percent is needed to store frequency divider information.
U.S. Pat. No. 4,537,108 to Shiramizu discloses an electronic musical instrument with two variable frequency dividers. The instrument includes a code generator for generating a first code indicating a tone pitch and a second code indicating an octave. The first variable frequency divider is presettable to a first count value as a function of the first code for counting master clock pulses supplied from an oscillator and generating a first divider output when the first count value is reached. The second variable frequency divider is presettable to a second count value as a function of the second code for counting the first divider output and generating a plurality of pulse trains with an octave frequency relationship. While Shiramizu teaches an instrument that generates codes corresponding to pitch tones, it further teaches storing pitch tone data in a ROM as a nine-bit value. Thus, similar to the music box of FIG. 1, the instrument of Shiramnizu requires a significant amount of memory to store pitch tone data and melody information.
In view of the foregoing, there is a need for methods and apparatus that minimize the required memory for frequency division information storage in music boxes and other devices.